<?PHP
if (!session_start()) { session_start(); };
/*if (!isset($_SESSION['lgnapproved'])) {
	die(header('Location: login.php'));
}*/

include("functions.php");
include("cnnxn.php");
connect();

if (isset($_POST['submit'])) {
	
	$combineddate=$_POST['eventdate_year'].'-'.$_POST['eventdate_month'].'-'.$_POST['eventdate_day'];
	$qualifier=0;
	if (isset($_POST['IsUSOpenQualifier'])) {
		$qualifier=1;
	}

	$SQLadd='INSERT INTO Tournaments (StartDate,Name,IsUSOpenQualifier) VALUES ("'.$combineddate.'","'.$_POST['Name'].'",'.$qualifier.');';
	//print $SQLadd;
	$sendit_add=mysqli_query($db,$SQLadd) or die(mysqli_error($db));
	die(header("Location: Tournaments_viewall.php"));
}
?>